<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script type="text/javascript" src="../js/vue.js"></script>
  <title>组件化</title>
</head>
<body>
  <div id="root">
    <Tit></Tit>
    <hr>
  </div>
  <script type="text/javascript">
    // 1.  创建组件
    const Hello = {
      template:`
				<div><h3>你好 世界 !!!</h3></div>
			`
    }
    const Tit = {
      data() {
        return {
          con:"Hello Vue !!!"
        }
      },
      components:{
        Hello
      },
      template:`
				<div>
					<h3>{{con}}</h3>
          <Hello></Hello>
        </div>
			`
    }

    const vm = new Vue({
      el:'#root', 
      // 2. 注册组件
      components:{
        Tit
      }
    }) 
  </script>
</body>
</html>